package byopenwrt

import (
	"errors"
	"net"
)

const(
	NetTypeStatic=0
	NetTypeDhcp=iota
	NetTypeUnknown=iota
)
type NetConfig struct{
	Type int `json:"type"`
	Ip string `json:"ip"`
	Mask string `json:"mask"`
	Gateway string `json:"gateway"`
	Mac string `json:"mac"`
}
func CheckNetWorkConfig(cfg *NetConfig)error{
	return nil
	address := net.ParseIP(cfg.Ip)
	if address == nil {
		return errors.New("ip format error")
	}
	mask := net.ParseIP(cfg.Mask)
	if mask == nil {
		return errors.New("mask format error")
	}
	return nil
}

